package com.ocom.webapi;

import com.ocom.common.utils.RSAUtils;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;

@SpringBootTest
public class Base64Test7 {


	/**
	 {"token":"23028970231721532217418241501336","expiredate":"20991231235959"}
	 */



	@Test
	public void tes() throws Exception {

	TestRequest1.UserInfo userInfo =new TestRequest1.UserInfo();


		RSAPublicKey rsaPublicKey = (RSAPublicKey) RSAUtils.getPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtafJApTJRucb7yPpveBAxVC9hGDnXBuj+E5IFBwj3hpgAuO1yjiL9pgsfzcHW6JLLzQryTr/quYIqW00O0jQhAxA9g/THbm/roziMbVS/5r8sbVkLLCy0z3pPTguNBwoqX++fMy3co2YQIYQCDc6jDHp6j3WdLa7VSYpZXzf73AFAk1AANzPZacreE6hIRd+g6FripSbyGVBxaNro+5dj1hsfswNHtZXWb0FaZBRWbF2AGkBS8K/QJGwtLOUgAt8qReWm+VWQWWOuIrQNPrMVu7/wr8os088RNlvDoFGYiIhQRLqTMtoUBE4Jjkp5wPt+C7/VgF3sQAL+M9WnpMydQIDAQAB");

		RSAPrivateKey rsaPrivateKey = (RSAPrivateKey)RSAUtils.getPrivateKey("MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC6EMS5IlU0h7KfVM1FQJZFlOlHvvX39tenzwPgj2E8bJKVD2C/gM4qc6MTYTdaA2q5zOMg7ZSmQAaJofTFt4fNftGNiop8xiTi5Xje80Ig4tKRlc6NOugQ3ubi+bNmm6VIS1l6wdvjOFvXUfAagYGCsI9dAzoHQgdTQmfu2c9ek1rwnsdSz5ea3MqXIfju0o3IIoDis2oHhsiRFpbM7AYmZg6ezdgJhepZTzXLjH3ESojzfTT6EPpYBrZRBYzU3ppzPNXYQHx4qSN8C63EuPbMTSWON5pmPGettxZn2ZNgZjM/WN4uNil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L7skeCqXsMxGtGSpsRwmMGzSxoowkx8nO1OEHON1xBPqyhIX88XqnLAbuyHpGV9V7A2tVfUYCj3h7ptvVhQHuftB7svig2pJn71bcVfh2i5k02KFFXmmRZ3XYcp86pl6yio4UGVpkR4ieV7UFzUfjcXRC+27VGCSN79BfTYff5K");


		String enc = "26ab2de012d55a7966bbc9d8097d7e54e743fe308ed782337b4d4acee590e709bb5d9282e63ac7c8b2363448a868f97a11968943a7336dd8fb718830319b8eccd7806edf9635fba61a8ef8e064ba88b9586bd9e41c54beb3f19d496c4b1239a5389ae1c72b8d71283f88e3ad46c5ddd5f21b748e4e9856bb7df182fc9f4deb3141aaf92082c13240d106ded68a7d61dcfa920244806e09c124e7d27b466196256691630942cefdaafcdc72eb427bc59ef158489a8d7a8bddef98d3e20e3737a7e7f5123a4b81aca6469e04041839e9f0a5a3311123f5a7165d875a4c4d442d55777b5ae9723486d2a98fe4170af3248c2f3f43d498700a11091348d6d19431fa";


		String sre = RSAUtils.decryptByPublic(enc,rsaPublicKey);

		System.out.println(sre);



	}

}
